/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package models.beans;

import java.util.ArrayList;
import java.util.List;
import models.dao.VehiculoDao;
import models.entity.Vehiculo;

/**
 *
 * @author hmardones
 */
public class VehiculoBean {
    
    private VehiculoDao vehiculoDao = new VehiculoDao();
    private String textoBusqueda = "";

    public String getTextoBusqueda() {
        return textoBusqueda;
    }

    public void setTextoBusqueda(String textoBusqueda) {
        this.textoBusqueda = textoBusqueda;
    }
        
    public List<Vehiculo> buscarVehiculos(){
        if(!textoBusqueda.equals("")){
             return  vehiculoDao.findString(this.textoBusqueda);
        }else{
            return  new ArrayList<Vehiculo>();
        }       
    }
    public List<Vehiculo> listaV(){
        return vehiculoDao.getVehiculo();
    }
}
